package cn.edu.hqu.cst.android.wzc.myapplication;

import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.alibaba.android.arouter.launcher.ARouter;

import butterknife.ButterKnife;
import butterknife.OnClick;
public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ARouter.openLog();
        ARouter.openDebug();//由于ARouter会缓存，打开才能即使更新页面
        ARouter.init(getApplication());
        ButterKnife.bind(this);
    }
    @OnClick({R.id.btn_main_gravity,R.id.btn_main_linear_accel,R.id.btn_main_ambient_temp})
    void SensorTest(View v){
        switch (v.getId()){
            case R.id.btn_main_gravity:
                ARouter.getInstance().build("/app/GravityActivity").navigation();
                break;
            case R.id.btn_main_linear_accel:
                ARouter.getInstance().build("/app/LinearAccelActivity").navigation();
                break;
            case R.id.btn_main_ambient_temp:
                ARouter.getInstance().build("/app/AmbientActivity").navigation();
                break;
        }
    }
}
